import { instance } from "../utils/request";
const getAccountsPagination = async (page:number,limit:number,key?:string) => {
	return await instance.get("/Accounts/Pagination", {page,limit,key});
};

const addAccounts = async (data:RequestCreateAccountsDto) => {
	return await instance.post("/Accounts/Add", data);
};

const updateAccounts = async (data:RequestUpdateAccountsDto) => {
	return await instance.post("/Accounts/Update", data);
};

const getAccountsDetail = async (id:number) => {
	return await instance.get("/Accounts/Detail", { id  });
};

const deleteAccounts = async (data:RequestIdAccountsDto) => {
	return await instance.post("/Accounts/Delete", data);
};

const AccountsApi = {
	getAccountsPagination,
	addAccounts,
	updateAccounts,
	getAccountsDetail,
	deleteAccounts,
};

export default AccountsApi
